﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Soft
{
    public interface IError
    {
   
        /// <summary>
        /// 错误码
        /// </summary>
        int ErrorCode { get; }

        /// <summary>
        /// 错误集合
        /// </summary>
        InformationCollection Error { get; }

 
        /// <summary>
        /// 添加错误
        /// </summary>
        /// <param name="text"></param>
        /// <param name="sender"></param>
        void AddError(string text, object sender);


        /// <summary>
        /// 添加错误
        /// </summary>
        /// <param name="result"></param>
        void AddError(IResult result);


        /// <summary>
        /// 添加错误
        /// </summary>
        /// <param name="e"></param>
        /// <param name="sender"></param>
        void AddError(Exception e, object sender);


        /// <summary>
        /// 添加错误
        /// </summary>
        /// <param name="e"></param>
        void AddError(IErrorMessage e);


        /// <summary>
        ///清除错误 
        /// </summary>
        void ClearError();

    }
}
